<template>
  <div class="DynamicArticles">
    <el-page-header @back="goback" content="赛事动态">
    </el-page-header>
    <div class="richText_title">
      <h1>{{richText.title}}</h1>
    </div>
    <div class="richText_image">
      <el-image :src="richText.images">
        <div slot="placeholder" class="image-slot">
          加载中<span class="dot">...</span>
        </div>
<!--        <div slot="error" class="image-slot">-->
<!--          <i class="el-icon-picture-outline"></i>-->
<!--        </div>-->
      </el-image>
    </div>
    <div class="richText_text">
      <div class="ql-editor " v-html="richText.text">{{ richText.text }}</div>
    </div>
  </div>
</template>

<script>

export default {
  name: "DynamicArticles",
  data() {
    return{
      richText: {
      }
    }
  },
  methods: {
    goback(){
      this.$router.push('/information/EventDynamics')
    },
    // 通过文章id获取文章
    async getArticleByID(){
      const data  = {};
      data.id = window.sessionStorage.getItem('TextID');
      const text = await this.$api.getArticleByID(data)
      this.richText = text.article;
    }
  },
  mounted() {
    this.getArticleByID();
  }
}
</script>

<style lang="less" scoped>
.DynamicArticles{
  background-color: #ffffff;
  margin: 0 40px;
  padding: 10px 20px;
  .richText_title{
    width: 1550px;
    margin: 0 auto;
    font-size: 25px;
    padding: 20px 20px;
    text-align: center;
  }
  .richText_image{
    width: 1550px;
    height: 500px;
    //background-color: #409EFF;
    margin: 0 auto;
    margin-bottom: 20px;
    .el-image{
      height: 500px;
      width: 100%;
      .image-slot{
        line-height: 500px;
        text-align: center;
        font-size: 400px;
      }
    }
  }
  .richText_text{
    width: 1550px;
    margin: 20px auto;

  }
}
</style>
